import request from '@/utils/request'

// 查询仓库的信息
export function getWarehouseUserInfo(data) {
    return request({
        url: '/wms/stocks/warehouse/get/getWarehouseUserInfo',
        method: 'post',
        data
    })
}

//   获取物料下的仓库信息
// wms/stocks/warehouse/isolation/getMaterialWarehouseList
export function getMaterialWarehouseList(data) {
    return request({
        url: '/wms/stocks/warehouse/isolation/getMaterialWarehouseList',
        method: 'post',
        data
    })
}

export function getAllocationStock(params,id) {
    return request({
        url: '/wms/allocation/getStock/' + id,
        method: 'get',
        params
    })
}

// 查询物料的默认仓库
export function getDefaultWarehouse(data) {
    return request({
        url: '/wms/stocks/warehouse/get/defaultWarehouse',
        method: 'post',
        data
    })
}
//  创建采购订单
export function purchaseStocksInsert(data) {
    return request({
        url: '/purchaseStocks/insert/released',
        method: 'post',
        headers: { 'jun-path': '1' },
        data
    })
}

// 获取采购订单编号
export function getPurchaseCode() {
    return request({
        url: '/purchaseStocks/get/purchaseCode',
        method: 'get',
        headers: { 'jun-path': '1' }
    })
}

//  查询供应商
export function getSuppliers(params) {
    return request({
        url: '/api/suppliers/list',
        method: 'get',
        params
    })
}
// 新增入库单后 -- 批量添加批次生产日期
export function updateStockInventory(data) {
    return request({
        url: '/purchaseStocks/update/stockInventory ',
        method: 'post',
        headers: { 'jun-path': '1' },
        data
    })
}

// 批次关联入库单
// purchaseStocks/add/relateBarCode
export function addRelateBarCode(params) {
    return request({
        url: '/purchaseStocks/add/relateBarCode',
        method: 'post',
        headers: { 'jun-path': '1' },
        params
    })
}

//  检查批次是否存在
export function checkBarCode(params) {
    return request({
        url: '/purchaseStocks/checkBarCode',
        method: 'get',
        headers: { 'jun-path': '1' },
        params
    })
}

// 批量新增批次
export function batchAddBarCode(data) {
    return request({
        url: '/purchaseStocks/batch/add/barCode',
        method: 'post',
        headers: { 'jun-path': '1' },
        data
    })
}